package com.googlecode.microanalyst.palette.plugin;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class MicroanalystPalettePlugin extends AbstractUIPlugin {

	private static BundleContext context;

	private static MicroanalystPalettePlugin singleton;

	public static MicroanalystPalettePlugin getDefault() {
		return singleton;
	}

	public MicroanalystPalettePlugin() {
		if (singleton == null) {
			singleton = this;
		}
	}

	static BundleContext getContext() {
		return context;
	}

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext bundleContext) throws Exception {
		MicroanalystPalettePlugin.context = bundleContext;
	}

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext bundleContext) throws Exception {
		MicroanalystPalettePlugin.context = null;
	}

}
